//
//  NCommentViewController.m
//  ieGou
//
//  Created by 嚷蜗痕殇心 on 15/1/29.
//  Copyright (c) 2015年 chaox. All rights reserved.
//

#import "NCommentViewController.h"
#import "NXiJieCell.h"
#import "NDetailsViewController.h"
@interface NCommentViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic, retain)UITableView *tableView;
@end

@implementation NCommentViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    //self.view.backgroundColor = [UIColor yellowColor];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemReply target:self action:@selector(buttonAction:)];
    self.title = @"评价详情";
    
    [self createTableView];
    [self createView];
    
    
}
//设置TableView
- (void)createTableView
{
    
    self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 120, 375, self.view.frame.size.height - 164) style:UITableViewStylePlain];
    _tableView.backgroundColor = [UIColor whiteColor];
    _tableView.dataSource = self;
    _tableView.delegate = self;
    [self.view addSubview:_tableView];
    [_tableView release];
    
}
//UIView
- (void)createView
{
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 64, 375, 120)];
    view.backgroundColor = [UIColor lightGrayColor];
    
    UILabel *tLabel = [[UILabel alloc]init];
    tLabel.text = @"233";
    [view addSubview:tLabel];
    [tLabel release];
    
    UILabel *pLabel = [[UILabel alloc]init];
    pLabel.text = @"总体评价";
    [view addSubview:pLabel];
    [pLabel release];
    
    UIImageView *imageTU = [[UIImageView alloc]init];
    imageTU.backgroundColor = [UIColor cyanColor];
    [view addSubview:imageTU];
    [imageTU release];
    
    UILabel *numLabel = [[UILabel alloc]init];
    numLabel.text = @"666";
    [view addSubview:numLabel];
    [numLabel release];
    
    tLabel.frame = CGRectMake(20, 20, 100, 50);
    pLabel.frame = CGRectMake(23, 70, 100, 30);
    imageTU.frame = CGRectMake(120, 70, 130, 30);
    numLabel.frame = CGRectMake(290, 80, 30, 20);
    
    [self.view addSubview:view];
    [view release];
}
//返回按钮
-(void)buttonAction:(UIBarButtonItem *)barButton
{
    NDetailsViewController *nDeta = [[NDetailsViewController alloc]init];
    [self.navigationController pushViewController:nDeta animated:YES];
    [nDeta release];
}

//tableView的初始化
//分区的行数
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
        return 100;
    
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
        static NSString *str1 = @"strr";
        NXiJieCell *cell = [tableView dequeueReusableHeaderFooterViewWithIdentifier:str1];
        if (cell == nil) {
            cell = [[NXiJieCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:str1];
            
        }
        tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        return cell;
    
}
//分区的个数
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 10;
}
//cell的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 200.f;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
